Skip to main content

Plugin Template

This is a template for creating plugins for simply-xp.

[JS] myPlugin Template

const MyNewPlugin = {
name: "myPlugin", // [REQUIRED] The name of your plugin
functions: [ // [OPTIONAL] Override XP functions here
addXP = (userId, guildId) => {
// Do something
}
],
initialize: (xp) => { // [REQUIRED] The function to run on plugin initialization
// Do something
},
requiredVersions: ["1"] // [OPTIONAL] The required versions of simply-xp
};

export default MyNewPlugin; // Export your plugin, so users can register it

[JS] Registering myPlugin

const {registerPlugins} = require("simply-xp");
const {MyNewPlugin} = require("myPlugin");

registerPlugins([MyNewPlugin])
.catch(console.error); // Returns the error